#pragma once
#include "Header.h"
#include <map>
#include <string>

struct IATHOOK
{
    ULONG_PTR lpSrcFunc;
    ULONG_PTR* lpIatAddress;

    IATHOOK(IN ULONG_PTR* IatAddress, IN ULONG_PTR SrcFunc)
    {
        lpIatAddress = IatAddress;
        lpSrcFunc = SrcFunc;
    }
};
using PIATHOOK = IATHOOK*;

class CIatHook
{
private:
    std::map<std::string, PIATHOOK> m_IatHookMap;

public:
    CIatHook();
    ~CIatHook();

public:
    BOOL IatHook(IN const char* szModuleName, IN const char* szFunctionName, IN ULONG_PTR SrcFunc, IN ULONG_PTR NewFunc);
    BOOL Remove(IN const char* szFunctionName);
    void RemoveAll();
};

extern CIatHook g_IatHook;
